import { User } from './form';

interface Project {
  id: string;
  name: string;
  personId: string;
  organization: string;
  created: string;
}
interface ListProps {
  lists: Project[];
  users: User[];
}
const List: React.FC<any> = ({ lists, users }: ListProps) => {
  return (
    <table>
      <thead>
        <tr>
          <th>名称</th>
          <th>负责人</th>
        </tr>
      </thead>
      <tbody>
        {lists.map((item, index) => (
          <tr key={index}>
            <th>{item.name}</th>
            <th>
              {users.find((user) => user.id === item.personId)?.name || '未知'}
            </th>
          </tr>
        ))}
      </tbody>
    </table>
  );
};

export default List;
